<?php

/**
 * @author shuang
 * @date 2016-11-4 9:24:58
 */
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use common\components\MTools;

$this->title = "申诉任务详情";
$this->registerJsFile('/js/task.js', [\frontendm\assets\AppAsset::className(), "depends" => "frontendm\assets\AppAsset"]);
$this->registerJs('task.init({hideBtn:".nodo , .noyc",hideUrl:"' . Url::toRoute(["hidetask"]) . '"});task.hideBtn();task.upImgbind();task.submitTask();', 3);
?>
<div class="content native-scroll">
    <div class="card">
        <div class="card-header txt-break"><?php echo ArrayHelper::getValue($data, "taskID.title"); ?></div>
        <div class="card-content">
            <?php if (ArrayHelper::getValue($data, "taskID.note")): ?>
                <div id="taskDesc" class="card-content-inner clr-gray txt-break">
                    <div class="item-after"><?php echo ArrayHelper::getValue($data, "taskID.note"); ?>
                        <?php if (ArrayHelper::getValue($data, "taskID.vote_address")): ?>
                            <a href="<?php echo ArrayHelper::getValue($data, "taskID.vote_address"); ?>" target="_blank">【点击任务链接】</a>
                        <?php endif; ?>
                    </div>
                </div>
            <?php endif; ?>
            <div class="list-block">
                <ul>
                    <?php if (ArrayHelper::getValue($data, "taskID.publicode")): ?>
                        <li class="item-content">
                            <div class="item-inner">
                                <div class="item-title">关注微信号</div>
                                <div class="item-after" style="white-space: normal;max-height: 6.4rem;"><?php echo ArrayHelper::getValue($data, "taskID.publicode"); ?></div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <?php if (ArrayHelper::getValue($data, "taskID.areaname")): ?>
                        <li class="item-content">
                            <div class="item-inner">
                                <div class="item-title">区域</div>
                                <div class="item-after"><?php echo ArrayHelper::getValue($data, "taskID.areaname"); ?></div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <?php if (ArrayHelper::getValue($data, "taskID.description")): ?>
                        <li class="item-content">
                            <div class="item-inner">
                                <div class="item-title">描述</div>
                                <div class="item-after"><?php echo ArrayHelper::getValue($data, "taskID.description"); ?></div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <li class="item-content">
                        <div class="item-inner">样图</div>
                    </li>
                    <li class="item-content">
                        <div class="item-inner">
                            <div class="weui_media_hd">
                                <?php echo Html::tag('img', '', ['src' => MTools::Qiniu480(ArrayHelper::getValue($data, "taskID.sample_figure")), 'class' => 'img-thumbnail weui_media_appmsg_thumb', 'width' => "100%"]); ?>
                            </div>
                        </div>
                    </li>
                    <?php if (ArrayHelper::getValue($data, "taskID.qrcode")): ?>
                        <li class="item-content">
                            <div class="item-inner">长按二维码保存到本地</div>
                        </li>
                        <li class="item-content">
                            <div class="item-inner">
                                <div class="weui_media_hd">
                                    <?php echo Html::tag('img', '', ['src' => MTools::Qiniunow480(ArrayHelper::getValue($data, "taskID.qrcode")), 'class' => 'img-thumbnail weui_media_appmsg_thumb', 'width' => "100%"]); ?>
                                </div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <li class="item-content">
                        <div class="item-inner">上传任务图片</div>
                    </li>
                    <li class="item-content">
                        <div class="item-inner">
                            <form id="addForm" url="<?php echo Url::toRoute(["appeal", "id" => $data["id"]]); ?>" method="post" enctype="multipart/form-data" imglen="<?php echo ArrayHelper::getValue($data, "taskID.sample_figure_count");?>">
                                <div class="weui_cell weui_cell_warn">
                                    <div class="weui_cell">
                                        <li class="item-content">第一张</li>
                                        <div class="weui_cell_bd weui_cell_primary">
                                            <div class="weui_uploader">
                                                <div class="weui_uploader_hd weui_cell">
                                                    <div class="weui_cell_bd weui_cell_primary"></div>
                                                </div>
                                                <div class="weui_uploader_bd">
                                                    <ul class="weui_uploader_files" style="float:left;">
                                                    </ul>

                                                    <div class="weui_uploader_input_wrp">
                                                        <input class="weui_uploader_input" type="file" id="qrpickfiles" name="task_image[]"  accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php if (ArrayHelper::getValue($data, "taskID.sample_figure_count") > 1): ?>
                                    <div class="weui_cell weui_cell_warn">
                                        <div class="weui_cell">
                                            <li class="item-content">第二张</li>
                                            <div class="weui_cell_bd weui_cell_primary">
                                                <div class="weui_uploader">
                                                    <div class="weui_uploader_hd weui_cell">
                                                        <div class="weui_cell_bd weui_cell_primary"></div>
                                                    </div>
                                                    <div class="weui_uploader_bd">
                                                        <ul class="weui_uploader_files2" style="float:left;">
                                                        </ul>

                                                        <div class="weui_uploader_input_wrp">
                                                            <input class="weui_uploader_input" type="file" id="qrpickfiles2" name="task_image[]"  accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php endif; ?>
                                <?php if (ArrayHelper::getValue($data, "taskID.is_offer_mobile") == 1): ?>
                                    <li class="item-content" style="margin-bottom: 10px;">
                                        <div style="width:250px;">提供注册手机号</div>
                                        <input type="text" id="taskaccount" name="taskaccount" style="border:1px solid #ccc;"/> 
                                    </li>
                                <?php endif; ?>
                                <div class="content-block">
                                    <input type="button" value="提交任务" class="button button-big button-fill button-success" id="btnSubmit"></a>
                                </div>
                            </form>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>